package org.gy.T9;

import java.io.PrintStream;

public class PrintTest2 {
    public static void main(String[] args) {
        System.out.println("⽼骥伏枥");
        System.out.println("志在千⾥");
        try (PrintStream ps = new PrintStream("C:/file-io-app2/src/itheima09.txt"); ){
// 把系统默认的打印流对象改成⾃⼰设置的打印流
            System.setOut(ps);
            System.out.println("烈⼠暮年");
            System.out.println("壮⼼不已");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
